package com.lagou.studentsystem.service.impl;

import com.lagou.studentsystem.dao.ClassesDao;
import com.lagou.studentsystem.dao.Impl.ClassesDaoImpl;
import com.lagou.studentsystem.model.Classes;
import com.lagou.studentsystem.model.PageBean;
import com.lagou.studentsystem.model.Student;
import com.lagou.studentsystem.service.ClassesService;

import java.util.List;

public class ClassesServiceImpl implements ClassesService {

    private ClassesDao classesDao;

    public ClassesServiceImpl() {
        this.classesDao = new ClassesDaoImpl();
    }

    @Override
    public List<Classes> getClassesAll() {
        return classesDao.getClassesAll();
    }

    @Override
    public int saveClasses(Classes classes) {
        return classesDao.insertClasses(classes);
    }

    @Override
    public int removeClassesById(String id) {

        return classesDao.deleteClassesById(id);
    }

    @Override
    public int updateClassesById(String id, Classes classes) {
        return classesDao.updateClassesById(id,classes);
    }

    @Override
    public Classes getClassesById(String id) {
        return classesDao.getClassesById(id);
    }

    @Override
    public List<Classes> getClassesByName(String name) {
        return classesDao.getClassesByName(name);
    }

    @Override
    public List<Classes> classesShowService(PageBean pageBean) {
        return classesDao.classesShow(pageBean);
    }
}
